//
//  WeakProxyViewController.m
//  ObjectCProject
//
//  Created by lvfeijun on 2021/5/21.
//

#import "ProxyViewController.h"
#import "WeakProxy.h"

@interface ProxyViewController ()

@property (strong,nonatomic) NSTimer *timer;

@end

@implementation ProxyViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.timer = [NSTimer timerWithTimeInterval:1 target:[WeakProxy proxyWithTarget:self] selector:@selector(run) userInfo:nil repeats:YES];
    [[NSRunLoop mainRunLoop] addTimer:self.timer forMode:NSRunLoopCommonModes];
}

-(void)run{
    NSLog(@"1");
}

- (void)dealloc
{
    [self.timer invalidate];
    NSLog(@"NSTimer dealloc");
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
